package gameEnvironment;

import java.awt.image.BufferedImage;
import java.io.File;

import javax.swing.ImageIcon;
import javax.swing.JLabel;

import gameItems.Items;
import gameAudio.Audio;
/**
 * @author Logical Solutions
 *
 */
public class Environment {
	Audio aud = new Audio();
	
	private static final File[] file = 	{	new File("src/gameEnvironment/WTC-Prelude4-1.mid"),
											new File("src/gameEnvironment/water drip.mid"),
											new File("src/gameEnvironment/WTC-Prelude4.mid"),
											new File("src/gameMiniGames/WTC-Prelude4-1.mid"),
											new File("src/gameMiniGames/WTC-Prelude4-1.mid"),
											new File("src/gameMiniGames/WTC-Prelude4-1.mid"),
											new File("src/gameMiniGames/WTC-Prelude4-1.mid"),
											new File("src/gameMiniGames/WTC-Prelude4-1.mid"),
											new File("src/gameMiniGames/WTC-Prelude4-1.mid"),
											new File("src/gameMiniGames/WTC-Prelude4-1.mid"),
											new File("src/gameMiniGames/WTC-Prelude4-1.mid"),
											new File("src/gameMiniGames/WTC-Prelude4-1.mid"),
											new File("src/gameMiniGames/WTC-Prelude4-1.mid"),
											new File("src/gameMiniGames/WTC-Prelude4-1.mid"),
											new File("src/gameMiniGames/WTC-Prelude4-1.mid"),
											new File("src/gameMiniGames/WTC-Prelude4-1.mid"),
											new File("src/gameMiniGames/WTC-Prelude4-1.mid"),
											new File("src/gameMiniGames/WTC-Prelude4-1.mid"),
											new File("src/gameMiniGames/WTC-Prelude4-1.mid")};
	
	private static final Room[] totalRooms = {	new Room("src/roomImages/Foyer.jpg"),
												new Room("src/roomImages/basement.jpg"), 
												new Room("src/roomImages/GreatRoom.jpg"),
												new Room("src/roomImages/Office.jpg"),
												new Room("src/roomImages/GuestRoom.jpg"),
												new Room("src/roomImages/Bathroom.jpg"),
												new Room("src/roomImages/MapRoom.jpg"),
												new Room("src/roomImages/DiningRoom.jpg"),
												new Room("src/roomImages/Kitchen.jpg"),
												new Room("src/roomImages/Pool.jpg"),
												new Room("src/roomImages/TigerRoom.jpg"),
												new Room("src/roomImages/MasterBedroom.jpg"),
												new Room("src/roomImages/Hall.jpg"),
												new Room("src/roomImages/Entertain.jpg"),
												new Room("src/roomImages/Patio.jpg"),
												new Room("src/roomImages/HedgeMaze.jpg"),
												new Room("src/roomImages/GuestRoom2.jpg"),
												new Room("src/roomImages/Bathroom2.jpg"),
												new Room("src/roomImages/GreatRoomTop.jpg")};
	JLabel room;
	
	public Environment()
	{
		room = new JLabel(totalRooms[0]);
		//totalRooms[0].isVisited=true;
		//roomPane.add(room, new Integer(-1), 0);
		room.setBounds(0,0,640,480);
	}
	public int totalRooms()
	{
		return totalRooms.length;
	}
	public ImageIcon getRoom(int roomValue)
	{
		return totalRooms[roomValue];
	}	
	/*public ImageIcon getHSRoom(int roomValue)
	{
		return HSRooms[roomValue];
	}*/
	
	/*private void addItem(Items item)
	{
		
	}*/
	public void setVisited(int roomValue)
	{
		totalRooms[roomValue].isVisited=true;
	}
	public void playAudio(int roomValue)
	{
		/*int audio = roomValue;
		if(	audio == 3 || audio == 4 || 
			audio == 5 || audio == 6 || 
			audio == 7 || audio == 8 || 
			audio == 9 || audio == 10 || 
			audio == 11 || audio == 12 || 
			audio == 13 || audio == 14 || 
			audio == 15 || audio == 16 || 
			audio == 17 || audio == 18)
		{
			audio = 0;
		}*/
		//System.out.println("audio: " + audio);
		//System.out.println("room: " + roomValue);
		//aud.playMusic(file[audio], roomValue);
		aud.playMusic(file[roomValue], roomValue);
	}
}
